<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .clock{
            background: url(./clock.png) no-repeat center center;
            background-size: contain;
            /* background-size: cover; */
            /* background: url(./images/clock2.png) no-repeat center center; */
            width: 300px;
            height: 300px;
            position: relative;
        }
        .hour{
            background-color: #000;
            width: 8px;
            height: 70px;
            position: absolute;
            left: 146px;
            top: 125px;
        }
        .minute{
            background-color: #666;
            width: 4px;
            height: 90px;
            position: absolute;
            left: 148px;
            top: 105px;
        }
        .second{
            background-color: #999;
            width: 2px;
            height: 110px;
            position: absolute;
            left: 149px;
            top: 95px;
        }
    </style>
</head>
<body>
    <div class="clock">
        <div class="hour"></div>
        <div class="minute"></div>
        <div class="second"></div>
    </div>
    <script>
        const run =()=> {
            const date = new Date();
            const second = date.getSeconds();
            const minute = date.getMinutes();
            let hour = date.getHours();
            if(hour >= 12){
                hour -=12;
            }
            const hourEl = document.querySelector('.hour');
            const secondEl = document.querySelector('.second');
            const minuteEl = document.querySelector('.minute');

            hourEl.style.transform = `rotate(${hour * 30}deg) translateY(-35px)`;
            secondEl.style.transform = `rotate(${minute * 6}deg) translateY(-35px)`;
            minuteEl.style.transform = `rotate(${second * 6}deg) translateY(-35px)`;
        }
        run();
        setInterval(run,1000)
    </script>
</body>
</html>